<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><spring:message code="item.title" /></title>
</head>
<body>
<spring:message code="item.hint" />
<form:form method="post" modelAttribute="item" action="item.html">
<!--<form:errors path="*" cssClass="error" />-->
<form:hidden path="id" />
<fieldset>
<legend>
<c:choose>
	<c:when test="${empty param.id}">
		<spring:message code="item.add" />
	</c:when>
	<c:otherwise>
		<spring:message code="item.modify" />
	</c:otherwise>
</c:choose>
</legend>
<dl>
	<dt><label><spring:message code="item.date"/></label></dt>
	<dd><form:input path="date" id="datePicker"/></dd>
	<%-- 	<td><form:errors path="date"/></td> --%>
</dl>
<dl>
	<dt><label><spring:message code="item.type" /></label></dt>
	<dd>
			<form:select path="cat">
				<form:option value="">Please select</form:option>
				<form:options items="${catList}" itemValue="cid" itemLabel="desc" />
			</form:select>
	</dd>
	<%-- 	<td><form:errors path="cat"/><form:errors path="cat.desc"/></td> --%>
</dl>
<dl>
	<dt><label><spring:message code="item.cost"/></label></dt>
	<dd><form:input path="cost" /></dd>
	<%-- 	<td><form:errors path="cost" /></td> --%>
</dl>
<dl>
	<dt><label><spring:message code="item.remark"/></label></dt>
	<dd><form:textarea path="remark" rows="4"/></dd>
	<%-- 	<td><form:errors path="remark" /></td> --%>
</dl>
<p>
	<button type="submit" name="save"><spring:message code="item.button.save"/></button>
	<button type="submit" name="cancel"><spring:message code="item.button.cancel"/></button>
</p>
</fieldset>
</form:form>
</body>
</html>